// 消息模块
import httpAPI from '../utils/http.js'

export default {
  /**
   * 消息列表
   * @param {Object} projectId  项目id
   * @param {Object} type  消息类型
   * @param {Object} subType  消息细分类型
   */
  getMessagelist (projectId, type, subType) {
    return httpAPI.get(`system/message/${projectId}/myAppMsgList`, {
      type: type,
      subType: subType
    })
  },
  /**
   * 清除未读消息
   * @param {Object} projectId 项目id
   * @param {Object} ids 清除唯独id集合
   */
  delRead(ids) {
    return httpAPI.post('system/message/markAsRead', {
      messageIds: ids
    })
  },
  /**
   * @param {Object} id 巡检id
   */
  delInspection(id) {
    return httpAPI.post('system/message/markCcAsRead', {
      id
    })
  },
  getMessageCount(projectId) {
    return httpAPI.get(`system/message/${projectId}/myAppMsgCount`)
  }
}
